package com.linghu.service.Impl;

import com.linghu.bean.Furn;
import com.linghu.dao.FurnMapper;
import com.linghu.service.FurnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 令狐荣豪
 * @version 1.0
 */
@Service
public class FurnServiceImpl implements FurnService {
    @Resource
    FurnMapper furnMapper;
    @Override
    public void save(Furn furn) {
        furnMapper.insertSelective(furn);
    }

    //列表数据
    @Override
    public List<Furn> listAll() {
        return furnMapper.selectByExample(null);
    }

    @Override
    public void update(Furn furn) {
        furnMapper.updateByPrimaryKeySelective(furn);
    }

    @Override
    public Furn findById(Integer id) {
        return furnMapper.selectByPrimaryKey(id);
    }

    @Override
    public int del(Integer id) {
        return furnMapper.deleteByPrimaryKey(id);
    }


}
